Skip to content

Feature/track status history in new table - #6

Open
darreneid wants to merge 5 commits into
mainfrom
feature/track-status-history-in-new-table
Open

Feature/track status history in new table#6
darreneid wants to merge 5 commits into
mainfrom
feature/track-status-history-in-new-table

Conversation

@darreneid

Copy link
Copy Markdown
Collaborator

No description provided.

darreneid and others added 5 commits July 23, 2026 18:07
- add TopicStatusChange model + migration
- record changes from the admin controller (api_update) and post_created
- enforce allowed statuses in the controller

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- new migration adds user_id, post_id, and duration (bigint, NOT NULL),
  backfilling duration for existing rows from their created_at history
- record the acting user (api_update) or triggering post (post_creation)
- compute duration as seconds spent in the status being left, chained
  off the prior change and falling back to topic.created_at

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
For a topic with no existing status-change row, fall back to when the
current status was set (its topic_custom_fields row, captured before the
change) rather than topic.created_at, so pre-existing topics get an
accurate first duration instead of time-since-creation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- format Ruby files per the plugin's .streerc (trailing commas, 100-col
  wrap); routes/engine/spec were pre-existing violations
- add the schema annotation block to TopicStatusChange for the
  annotations_tests check

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant